﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;

namespace Phoenix.Xna.Framework.ContentPipeline.EffectMaps
{
    /// <summary>
    /// Writes EffectMaps through the content pipeline.
    /// </summary>
    [ContentTypeWriter]
    public class EffectMapWriter : ContentTypeWriter<EffectMapContent>
    {
        /// <summary>
        /// Writes the specified EffectMap.
        /// </summary>
        /// <param name="output">The ContentWriter used to write the EffectMap.</param>
        /// <param name="value">The content wrapper containing the EffectMap to write.</param>
        protected override void Write(ContentWriter output, EffectMapContent value)
        {
            output.Write(value.Serialize());
        }

        /// <summary>
        /// Gets the name of the Assembly that contains the reader for EffectMaps.
        /// </summary>
        /// <param name="targetPlatform">The target platform for the reader.</param>
        /// <returns>The qualified name of the reader.</returns>
        public override string GetRuntimeReader(TargetPlatform targetPlatform)
        {
            return typeof(EffectMapReader).AssemblyQualifiedName;
        }
    }
}
